<?php

/**
 * O2O团购PC版本
 * ============================================================================
 * * 版权所有 2009-2016 郑州司科计算机科技有限公司，并保留所有权利。
 * 购买网址: http://www.jzphp.com；
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件！您只能在不用于商业目的的前提下对程序代码进行修改和
 * 使用；不允许对程序代码以任何形式任何目的的再发布。
  * 咨询电话：400-823-0371 QQ：313999875
 * ============================================================================
 * $Author: zzsike $
 * $Time 2016-02-03 sammy $
*/


/* *
 * 用户提现

 *************************注意*************************
 * 
 */
require_once(dirname(dirname(dirname(dirname(__FILE__)))) . '/app.php');

need_manager();

$daytime = strtotime(date('Y-m-d'));
$id = abs(intval($_GET['id']));
$user = Table::Fetch('user', $id);

$condition = array(
	'user_id' => $id,
);

/* search */
$state = abs(intval($_GET['state']));
if($state) $condition['state'] = $state;

$count = Table::Count('withdraw', $condition);
list($pagesize, $offset, $pagestring) = pagestring($count, 20);

$withdraws = DB::LimitQuery('withdraw', array(
	'condition' => $condition,
	'order' => 'ORDER BY id DESC',
	'size' => $pagesize,
	'offset' => $offset,
));

//$partner_ids = Utility::GetColumn($incomes, 'partner_id');
//$partners = Table::Fetch('partner', $partner_ids);

$admin_ids = Utility::GetColumn($withdraws, 'admin_id');
$admins = Table::Fetch('user', $admin_ids);

$withdraw_state = array(
	'1' => '待提现',
	'2' => '拒绝',
	'4' => '正在提现',
	'8' => '已提现',
);

include template('manage_user_withdraw_index');
